home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Mac OS / ColorSync 3.0 Mac SDK / Interfaces / CMICCProfile.p < prev    next >
Encoding:
Text File  |  1999-10-28  |  28.0 KB  |  852 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMICCProfile.p
  3.  
  4.      Contains:    ICC Profile Format Definitions
  5.  
  6.      Version:    Technology:    ColorSync 2.5
  7.                  Release:    ColorSync 3.0 SDK for use with Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1994-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT CMICCProfile;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __CMICCPROFILE__}
  27. {$SETC __CMICCPROFILE__ := 1}
  28.  
  29. {$I+}
  30. {$SETC CMICCProfileIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN MAC68K}
  40. {$LibExport+}
  41.  
  42. { ICC Profile version constants  }
  43.  
  44. CONST
  45.     cmICCProfileVersion2        = $02000000;
  46.     cmICCProfileVersion21        = $02100000;
  47.     cmCS2ProfileVersion            = $02000000;
  48.     cmCS1ProfileVersion            = $00000100;                    {  ColorSync 1.0 profile version  }
  49.  
  50. { Current Major version number }
  51.     cmProfileMajorVersionMask    = $FF000000;
  52.     cmCurrentProfileMajorVersion = $02000000;
  53.  
  54. { magic cookie number for anonymous file ID }
  55.     cmMagicNumber                = 'acsp';
  56.  
  57.  
  58. {**********************************************************************}
  59. {************** ColorSync 2.0 profile specification *******************}
  60. {**********************************************************************}
  61. {*** flags field  ***}
  62.     cmICCReservedFlagsMask        = $0000FFFF;                    {  these bits of the flags field are defined and reserved by ICC  }
  63.     cmEmbeddedMask                = $00000001;                    {  if bit 0 is 0 then not embedded profile, if 1 then embedded profile  }
  64.     cmEmbeddedUseMask            = $00000002;                    {  if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only  }
  65.     cmCMSReservedFlagsMask        = $FFFF0000;                    {  these bits of the flags field are defined and reserved by CMS vendor  }
  66.     cmQualityMask                = $00030000;                    {  if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best  }
  67.     cmInterpolationMask            = $00040000;                    {  if bit 18 is 0 then interpolation, if 1 then lookup only  }
  68.     cmGamutCheckingMask            = $00080000;                    {  if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info  }
  69.  
  70. { copyright-protection flag options }
  71.     cmEmbeddedProfile            = 0;                            {  0 is not embedded profile, 1 is embedded profile  }
  72.     cmEmbeddedUse                = 1;                            {  0 is to use anywhere, 1 is to use as embedded profile only  }
  73.  
  74. { speed and quality flag options }
  75.     cmNormalMode                = 0;                            {  it uses the least significent two bits in the high word of flag  }
  76.     cmDraftMode                    = 1;                            {  it should be evaulated like this: right shift 16 bits first, mask off the  }
  77.     cmBestMode                    = 2;                            {  high 14 bits, and then compare with the enum to determine the option value  }
  78.  
  79.  
  80. {*** deviceAttributes fields ***}
  81. { deviceAttributes[0] is defined by and reserved for device vendors }
  82. { deviceAttributes[1] is defined by and reserved for ICC }
  83. { The following bits of deviceAttributes[1] are currently defined }
  84.     cmReflectiveTransparentMask    = $00000001;                    {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  85.     cmGlossyMatteMask            = $00000002;                    {  if bit 1 is 0 then glossy, if 1 then matte  }
  86.  
  87. { device/media attributes element values  }
  88.     cmReflective                = 0;                            {  if bit 0 is 0 then reflective media, if 1 then transparency media  }
  89.     cmGlossy                    = 1;                            {  if bit 1 is 0 then glossy, if 1 then matte  }
  90.  
  91.  
  92. {*** renderingIntent field ***}
  93.     cmPerceptual                = 0;                            {  Photographic images  }
  94.     cmRelativeColorimetric        = 1;                            {  Logo Colors  }
  95.     cmSaturation                = 2;                            {  Business graphics  }
  96.     cmAbsoluteColorimetric        = 3;                            {  Logo Colors  }
  97.  
  98.  
  99.  
  100. { data type element values }
  101.     cmAsciiData                    = 0;
  102.     cmBinaryData                = 1;
  103.  
  104. { screen encodings  }
  105.     cmPrtrDefaultScreens        = 0;                            {  Use printer default screens.  0 is false, 1 is ture  }
  106.     cmLinesPer                    = 1;                            {  0 is LinesPerCm, 1 is LinesPerInch  }
  107.  
  108. { 2.0 tag type information }
  109.     cmNumHeaderElements            = 10;
  110.  
  111. { public tags }
  112.     cmAToB0Tag                    = 'A2B0';
  113.     cmAToB1Tag                    = 'A2B1';
  114.     cmAToB2Tag                    = 'A2B2';
  115.     cmBlueColorantTag            = 'bXYZ';
  116.     cmBlueTRCTag                = 'bTRC';
  117.     cmBToA0Tag                    = 'B2A0';
  118.     cmBToA1Tag                    = 'B2A1';
  119.     cmBToA2Tag                    = 'B2A2';
  120.     cmCalibrationDateTimeTag    = 'calt';
  121.     cmCharTargetTag                = 'targ';
  122.     cmCopyrightTag                = 'cprt';
  123.     cmDeviceMfgDescTag            = 'dmnd';
  124.     cmDeviceModelDescTag        = 'dmdd';
  125.     cmGamutTag                    = 'gamt';
  126.     cmGrayTRCTag                = 'kTRC';
  127.     cmGreenColorantTag            = 'gXYZ';
  128.     cmGreenTRCTag                = 'gTRC';
  129.     cmLuminanceTag                = 'lumi';
  130.     cmMeasurementTag            = 'meas';
  131.     cmMediaBlackPointTag        = 'bkpt';
  132.     cmMediaWhitePointTag        = 'wtpt';
  133.     cmNamedColorTag                = 'ncol';
  134.     cmNamedColor2Tag            = 'ncl2';
  135.     cmPreview0Tag                = 'pre0';
  136.     cmPreview1Tag                = 'pre1';
  137.     cmPreview2Tag                = 'pre2';
  138.     cmProfileDescriptionTag        = 'desc';
  139.     cmProfileSequenceDescTag    = 'pseq';
  140.     cmPS2CRD0Tag                = 'psd0';
  141.     cmPS2CRD1Tag                = 'psd1';
  142.     cmPS2CRD2Tag                = 'psd2';
  143.     cmPS2CRD3Tag                = 'psd3';
  144.     cmPS2CSATag                    = 'ps2s';
  145.     cmPS2RenderingIntentTag        = 'ps2i';
  146.     cmRedColorantTag            = 'rXYZ';
  147.     cmRedTRCTag                    = 'rTRC';
  148.     cmScreeningDescTag            = 'scrd';
  149.     cmScreeningTag                = 'scrn';
  150.     cmTechnologyTag                = 'tech';
  151.     cmUcrBgTag                    = 'bfd ';
  152.     cmViewingConditionsDescTag    = 'vued';
  153.     cmViewingConditionsTag        = 'view';
  154.  
  155. { custom tags }
  156.     cmPS2CRDVMSizeTag            = 'psvm';
  157.     cmVideoCardGammaTag            = 'vcgt';
  158.     cmMakeAndModelTag            = 'mmod';
  159.  
  160. { technology tag descriptions }
  161.     cmTechnologyFilmScanner        = 'fscn';
  162.     cmTechnologyReflectiveScanner = 'rscn';
  163.     cmTechnologyInkJetPrinter    = 'ijet';
  164.     cmTechnologyThermalWaxPrinter = 'twax';
  165.     cmTechnologyElectrophotographicPrinter = 'epho';
  166.     cmTechnologyElectrostaticPrinter = 'esta';
  167.     cmTechnologyDyeSublimationPrinter = 'dsub';
  168.     cmTechnologyPhotographicPaperPrinter = 'rpho';
  169.     cmTechnologyFilmWriter        = 'fprn';
  170.     cmTechnologyVideoMonitor    = 'vidm';
  171.     cmTechnologyVideoCamera        = 'vidc';
  172.     cmTechnologyProjectionTelevision = 'pjtv';
  173.     cmTechnologyCRTDisplay        = 'CRT ';
  174.     cmTechnologyPMDisplay        = 'PMD ';
  175.     cmTechnologyAMDisplay        = 'AMD ';
  176.     cmTechnologyPhotoCD            = 'KPCD';
  177.     cmTechnologyPhotoImageSetter = 'imgs';
  178.     cmTechnologyGravure            = 'grav';
  179.     cmTechnologyOffsetLithography = 'offs';
  180.     cmTechnologySilkscreen        = 'silk';
  181.     cmTechnologyFlexography        = 'flex';
  182.  
  183. { public type signatures }
  184.     cmSigCurveType                = 'curv';
  185.     cmSigDataType                = 'data';
  186.     cmSigDateTimeType            = 'dtim';
  187.     cmSigLut16Type                = 'mft2';
  188.     cmSigLut8Type                = 'mft1';
  189.     cmSigMeasurementType        = 'meas';
  190.     cmSigNamedColorType            = 'ncol';
  191.     cmSigNamedColor2Type        = 'ncl2';
  192.     cmSigProfileDescriptionType    = 'desc';
  193.     cmSigScreeningType            = 'scrn';
  194.     cmSigS15Fixed16Type            = 'sf32';
  195.     cmSigSignatureType            = 'sig ';
  196.     cmSigTextType                = 'text';
  197.     cmSigU16Fixed16Type            = 'uf32';
  198.     cmSigU1Fixed15Type            = 'uf16';
  199.     cmSigUInt32Type                = 'ui32';
  200.     cmSigUInt64Type                = 'ui64';
  201.     cmSigUInt8Type                = 'ui08';
  202.     cmSigUnicodeTextType        = 'utxt';
  203.     cmSigViewingConditionsType    = 'view';
  204.     cmSigXYZType                = 'XYZ ';
  205.  
  206. { custom type signatures }
  207.     cmSigVideoCardGammaType        = 'vcgt';
  208.     cmSigMakeAndModelType        = 'mmod';
  209.  
  210.  
  211. { Measurement type encodings }
  212. { Measurement Flare }
  213.     cmFlare0                    = $00000000;
  214.     cmFlare100                    = $00000001;
  215.  
  216. { Measurement Geometry    }
  217.     cmGeometryUnknown            = $00000000;
  218.     cmGeometry045or450            = $00000001;
  219.     cmGeometry0dord0            = $00000002;
  220.  
  221. { Standard Observer    }
  222.     cmStdobsUnknown                = $00000000;
  223.     cmStdobs1931TwoDegrees        = $00000001;
  224.     cmStdobs1964TenDegrees        = $00000002;
  225.  
  226. { Standard Illuminant }
  227.     cmIlluminantUnknown            = $00000000;
  228.     cmIlluminantD50                = $00000001;
  229.     cmIlluminantD65                = $00000002;
  230.     cmIlluminantD93                = $00000003;
  231.     cmIlluminantF2                = $00000004;
  232.     cmIlluminantD55                = $00000005;
  233.     cmIlluminantA                = $00000006;
  234.     cmIlluminantEquiPower        = $00000007;
  235.     cmIlluminantF8                = $00000008;
  236.  
  237. { Spot Function Value }
  238.     cmSpotFunctionUnknown        = 0;
  239.     cmSpotFunctionDefault        = 1;
  240.     cmSpotFunctionRound            = 2;
  241.     cmSpotFunctionDiamond        = 3;
  242.     cmSpotFunctionEllipse        = 4;
  243.     cmSpotFunctionLine            = 5;
  244.     cmSpotFunctionSquare        = 6;
  245.     cmSpotFunctionCross            = 7;
  246.  
  247. { Color Space Signatures }
  248.     cmXYZData                    = 'XYZ ';
  249.     cmLabData                    = 'Lab ';
  250.     cmLuvData                    = 'Luv ';
  251.     cmYxyData                    = 'Yxy ';
  252.     cmRGBData                    = 'RGB ';
  253.     cmGrayData                    = 'GRAY';
  254.     cmHSVData                    = 'HSV ';
  255.     cmHLSData                    = 'HLS ';
  256.     cmCMYKData                    = 'CMYK';
  257.     cmCMYData                    = 'CMY ';
  258.     cmMCH5Data                    = 'MCH5';
  259.     cmMCH6Data                    = 'MCH6';
  260.     cmMCH7Data                    = 'MCH7';
  261.     cmMCH8Data                    = 'MCH8';
  262.     cm3CLRData                    = '3CLR';
  263.     cm4CLRData                    = '4CLR';
  264.     cm5CLRData                    = '5CLR';
  265.     cm6CLRData                    = '6CLR';
  266.     cm7CLRData                    = '7CLR';
  267.     cm8CLRData                    = '8CLR';
  268.     cmNamedData                    = 'NAME';
  269.  
  270. { profileClass enumerations }
  271.     cmInputClass                = 'scnr';
  272.     cmDisplayClass                = 'mntr';
  273.     cmOutputClass                = 'prtr';
  274.     cmLinkClass                    = 'link';
  275.     cmAbstractClass                = 'abst';
  276.     cmColorSpaceClass            = 'spac';
  277.     cmNamedColorClass            = 'nmcl';
  278.  
  279. { platform enumerations }
  280.     cmMacintosh                    = 'APPL';
  281.     cmMicrosoft                    = 'MSFT';
  282.     cmSolaris                    = 'SUNW';
  283.     cmSiliconGraphics            = 'SGI ';
  284.     cmTaligent                    = 'TGNT';
  285.  
  286. { ColorSync 1.0 elements }
  287.     cmCS1ChromTag                = 'chrm';
  288.     cmCS1TRCTag                    = 'trc ';
  289.     cmCS1NameTag                = 'name';
  290.     cmCS1CustTag                = 'cust';
  291.  
  292. { General element data types }
  293.  
  294. TYPE
  295.     CMDateTimePtr = ^CMDateTime;
  296.     CMDateTime = RECORD
  297.         year:                    UInt16;
  298.         month:                    UInt16;
  299.         dayOfTheMonth:            UInt16;
  300.         hours:                    UInt16;
  301.         minutes:                UInt16;
  302.         seconds:                UInt16;
  303.     END;
  304.  
  305.     CMFixedXYZColorPtr = ^CMFixedXYZColor;
  306.     CMFixedXYZColor = RECORD
  307.         X:                        Fixed;
  308.         Y:                        Fixed;
  309.         Z:                        Fixed;
  310.     END;
  311.  
  312.     CMXYZComponent                        = UInt16;
  313.     CMXYZColorPtr = ^CMXYZColor;
  314.     CMXYZColor = RECORD
  315.         X:                        CMXYZComponent;
  316.         Y:                        CMXYZComponent;
  317.         Z:                        CMXYZComponent;
  318.     END;
  319.  
  320.     CM2HeaderPtr = ^CM2Header;
  321.     CM2Header = RECORD
  322.         size:                    UInt32;                                    {  This is the total size of the Profile  }
  323.         CMMType:                OSType;                                    {  CMM signature,  Registered with CS2 consortium   }
  324.         profileVersion:            UInt32;                                    {  Version of CMProfile format  }
  325.         profileClass:            OSType;                                    {  input, display, output, devicelink, abstract, or color conversion profile type  }
  326.         dataColorSpace:            OSType;                                    {  color space of data  }
  327.         profileConnectionSpace:    OSType;                                    {  profile connection color space  }
  328.         dateTime:                CMDateTime;                                {  date and time of profile creation  }
  329.         CS2profileSignature:    OSType;                                    {  'acsp' constant ColorSync 2.0 file ID  }
  330.         platform:                OSType;                                    {  primary profile platform, Registered with CS2 consortium  }
  331.         flags:                    UInt32;                                    {  profile flags  }
  332.         deviceManufacturer:        OSType;                                    {  Registered with ICC consortium  }
  333.         deviceModel:            UInt32;                                    {  Registered with ICC consortium  }
  334.         deviceAttributes:        ARRAY [0..1] OF UInt32;                    {  Attributes[0] is for device vendors, [1] is for ICC  }
  335.         renderingIntent:        UInt32;                                    {  preferred rendering intent of tagged object  }
  336.         white:                    CMFixedXYZColor;                        {  profile illuminant  }
  337.         creator:                OSType;                                    {  profile creator  }
  338.         reserved:                PACKED ARRAY [0..43] OF CHAR;            {  reserved for future use  }
  339.     END;
  340.  
  341.     CMTagRecordPtr = ^CMTagRecord;
  342.     CMTagRecord = RECORD
  343.         tag:                    OSType;                                    {  Registered with CS2 consortium  }
  344.         elementOffset:            UInt32;                                    {  Relative to start of CMProfile  }
  345.         elementSize:            UInt32;
  346.     END;
  347.  
  348.     CMTagElemTablePtr = ^CMTagElemTable;
  349.     CMTagElemTable = RECORD
  350.         count:                    UInt32;
  351.         tagList:                ARRAY [0..0] OF CMTagRecord;            {  Variable size  }
  352.     END;
  353.  
  354. { External 0x02002001 CMProfile }
  355.     CM2ProfilePtr = ^CM2Profile;
  356.     CM2Profile = RECORD
  357.         header:                    CM2Header;
  358.         tagTable:                CMTagElemTable;
  359.         elemData:                SInt8;                                    {  Tagged element storage. Variable size  }
  360.     END;
  361.  
  362.     CM2ProfileHandle                    = ^CM2ProfilePtr;
  363. { Tag Type Definitions }
  364.     CMCurveTypePtr = ^CMCurveType;
  365.     CMCurveType = RECORD
  366.         typeDescriptor:            OSType;                                    {  'curv'  }
  367.         reserved:                UInt32;                                    {  fill with 0x00  }
  368.         countValue:                UInt32;                                    {  number of entries in table that follows  }
  369.         data:                    ARRAY [0..0] OF UInt16;                    {  Tagged element storage. Variable size  }
  370.     END;
  371.  
  372.     CMDataTypePtr = ^CMDataType;
  373.     CMDataType = RECORD
  374.         typeDescriptor:            OSType;                                    {  'data'  }
  375.         reserved:                UInt32;                                    {  fill with 0x00  }
  376.         dataFlag:                UInt32;                                    {  0 = ASCII, 1 = binary  }
  377.         data:                    SInt8;                                    {  Tagged element storage. Variable size  }
  378.     END;
  379.  
  380.     CMDateTimeTypePtr = ^CMDateTimeType;
  381.     CMDateTimeType = RECORD
  382.         typeDescriptor:            OSType;                                    {  'dtim'  }
  383.         reserved:                UInt32;
  384.         dateTime:                CMDateTime;
  385.     END;
  386.  
  387.     CMLut16TypePtr = ^CMLut16Type;
  388.     CMLut16Type = RECORD
  389.         typeDescriptor:            OSType;                                    {  'mft2'  }
  390.         reserved:                UInt32;                                    {  fill with 0x00  }
  391.         inputChannels:            SInt8;                                    {  Number of input channels  }
  392.         outputChannels:            SInt8;                                    {  Number of output channels  }
  393.         gridPoints:                SInt8;                                    {  Number of clutTable grid points  }
  394.         reserved2:                SInt8;                                    {  fill with 0x00  }
  395.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  396.         inputTableEntries:        UInt16;                                    {   }
  397.         outputTableEntries:        UInt16;                                    {   }
  398.         inputTable:                ARRAY [0..0] OF UInt16;                    {  Variable size  }
  399.         CLUT:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  400.         outputTable:            ARRAY [0..0] OF UInt16;                    {  Variable size  }
  401.     END;
  402.  
  403.     CMLut8TypePtr = ^CMLut8Type;
  404.     CMLut8Type = RECORD
  405.         typeDescriptor:            OSType;                                    {  'mft1'  }
  406.         reserved:                UInt32;                                    {  fill with 0x00  }
  407.         inputChannels:            SInt8;                                    {   }
  408.         outputChannels:            SInt8;                                    {   }
  409.         gridPoints:                SInt8;                                    {   }
  410.         reserved2:                SInt8;                                    {  fill with 0x00  }
  411.         matrix:                    ARRAY [0..2,0..2] OF Fixed;                {   }
  412.         inputTable:                PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  413.         CLUT:                    PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  414.         outputTable:            PACKED ARRAY [0..255] OF UInt8;            {  fixed size of 256  }
  415.     END;
  416.  
  417.     CMMeasurementTypePtr = ^CMMeasurementType;
  418.     CMMeasurementType = RECORD
  419.         typeDescriptor:            OSType;                                    {  'meas'  }
  420.         reserved:                UInt32;                                    {  fill with 0x00  }
  421.         standardObserver:        UInt32;                                    {  0 : unknown, 1 : CIE 1931, 2 : CIE 1964  }
  422.         backingXYZ:                CMFixedXYZColor;                        {  absolute XYZ values of backing  }
  423.         geometry:                UInt32;                                    {  0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0  }
  424.         flare:                    UInt32;                                    {  0 : 0%, 1 : 100% flare  }
  425.         illuminant:                UInt32;                                    {  standard illuminant  }
  426.     END;
  427.  
  428.     CMNamedColorTypePtr = ^CMNamedColorType;
  429.     CMNamedColorType = RECORD
  430.         typeDescriptor:            OSType;                                    {  'ncol'  }
  431.         reserved:                UInt32;                                    {  fill with 0x00  }
  432.         vendorFlag:                UInt32;                                    {   }
  433.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  434.         prefixName:                SInt8;                                    {  Variable size, max = 32, to access fields after this one, have to count bytes  }
  435.         suffixName:                SInt8;                                    {  Variable size, max = 32  }
  436.         data:                    SInt8;                                    {  varaible size data as explained below  }
  437.     END;
  438.  
  439. {    
  440.     A variable size array of structs appears as the last block of data
  441.     in the above struct, CMNamedColorType.  The data structure
  442.     is as follows: (example in C)
  443.     
  444.     struct (                                             
  445.         unsigned char    rootName[1];                 * Variable size, max = 32 
  446.         unsigned char    colorCoords[1];                 * Variable size  
  447.     ) colorName[1];                                     * Variable size  
  448. }
  449.     CMNamedColor2TypePtr = ^CMNamedColor2Type;
  450.     CMNamedColor2Type = RECORD
  451.         typeDescriptor:            OSType;                                    {  'ncl2'  }
  452.         reserved:                UInt32;                                    {  fill with 0x00  }
  453.         vendorFlag:                UInt32;                                    {  lower 16 bits reserved for ICC use  }
  454.         count:                    UInt32;                                    {  count of named colors in array that follows  }
  455.         deviceChannelCount:        UInt32;                                    {  number of device channels, 0 indicates no device value available  }
  456.         prefixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  457.         suffixName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  458.         data:                    SInt8;                                    {  varaible size data as definced below  }
  459.     END;
  460.  
  461.     CMNamedColor2EntryTypePtr = ^CMNamedColor2EntryType;
  462.     CMNamedColor2EntryType = RECORD
  463.         rootName:                PACKED ARRAY [0..31] OF UInt8;            {  32 byte field.  7 bit ASCII null terminated  }
  464.         PCSColorCoords:            ARRAY [0..2] OF UInt16;                    {  Lab or XYZ color  }
  465.         DeviceColorCoords:        ARRAY [0..0] OF UInt16;                    {  Variable size  }
  466.     END;
  467.  
  468.     CMTextDescriptionTypePtr = ^CMTextDescriptionType;
  469.     CMTextDescriptionType = PACKED RECORD
  470.         typeDescriptor:            OSType;                                    {  'desc'  }
  471.         reserved:                UInt32;                                    {  fill with 0x00  }
  472.         ASCIICount:                UInt32;                                    {  the count of "bytes"  }
  473.         ASCIIName:                PACKED ARRAY [0..1] OF UInt8;            {  Variable size, to access fields after this one, have to count bytes  }
  474.         UniCodeCode:            UInt32;
  475.         UniCodeCount:            UInt32;                                    {  the count of characters, each character has two bytes  }
  476.         UniCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  477.         ScriptCodeCode:            INTEGER;
  478.         ScriptCodeCount:        UInt8;                                    {  the count of "bytes"  }
  479.         ScriptCodeName:            PACKED ARRAY [0..1] OF UInt8;            {  Variable size  }
  480.     END;
  481.  
  482.     CMTextTypePtr = ^CMTextType;
  483.     CMTextType = RECORD
  484.         typeDescriptor:            OSType;                                    {  'text'  }
  485.         reserved:                UInt32;                                    {  fill with 0x00  }
  486.         text:                    SInt8;                                    {  count of text is obtained from tag size element  }
  487.     END;
  488.  
  489.     CMUnicodeTextTypePtr = ^CMUnicodeTextType;
  490.     CMUnicodeTextType = RECORD
  491.         typeDescriptor:            OSType;                                    {  'utxt'  }
  492.         reserved:                UInt32;                                    {  fill with 0x00  }
  493.         text:                    ARRAY [0..0] OF UInt16;                    {  count of text is obtained from tag size element  }
  494.     END;
  495.  
  496.     CMScreeningTypePtr = ^CMScreeningType;
  497.     CMScreeningType = RECORD
  498.         typeDescriptor:            OSType;                                    {  'scrn'  }
  499.         reserved:                UInt32;                                    {  fill with 0x00  }
  500.         screeningFlag:            UInt32;                                    {  bit 0 : use printer default screens, bit 1 : inch/cm  }
  501.         channelCount:            UInt32;
  502.         data:                    SInt8;                                    {  varaible size data as explained below  }
  503.     END;
  504.  
  505. {
  506.     A variable size array of structs appears as the last block of data
  507.     in the above struct, CMScreeningType.  The data structure
  508.     is as follows: (example in C)
  509.     
  510.     struct (
  511.         Fixed            frequency;
  512.         Fixed            angle;
  513.         unsigned long    sportFunction;
  514.      )    channelScreening[1];                        * Variable size 
  515. }
  516.     CMSignatureTypePtr = ^CMSignatureType;
  517.     CMSignatureType = RECORD
  518.         typeDescriptor:            OSType;                                    {  'sig '  }
  519.         reserved:                UInt32;                                    {  fill with 0x00  }
  520.         signature:                OSType;
  521.     END;
  522.  
  523.     CMS15Fixed16ArrayTypePtr = ^CMS15Fixed16ArrayType;
  524.     CMS15Fixed16ArrayType = RECORD
  525.         typeDescriptor:            OSType;                                    {  'sf32'  }
  526.         reserved:                UInt32;                                    {  fill with 0x00  }
  527.         value:                    ARRAY [0..0] OF Fixed;                    {  Variable size  }
  528.     END;
  529.  
  530.     CMU16Fixed16ArrayTypePtr = ^CMU16Fixed16ArrayType;
  531.     CMU16Fixed16ArrayType = RECORD
  532.         typeDescriptor:            OSType;                                    {  'uf32'  }
  533.         reserved:                UInt32;                                    {  fill with 0x00  }
  534.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  535.     END;
  536.  
  537.     CMUInt16ArrayTypePtr = ^CMUInt16ArrayType;
  538.     CMUInt16ArrayType = RECORD
  539.         typeDescriptor:            OSType;                                    {  'ui16'  }
  540.         reserved:                UInt32;                                    {  fill with 0x00  }
  541.         value:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  542.     END;
  543.  
  544.     CMUInt32ArrayTypePtr = ^CMUInt32ArrayType;
  545.     CMUInt32ArrayType = RECORD
  546.         typeDescriptor:            OSType;                                    {  'ui32'  }
  547.         reserved:                UInt32;                                    {  fill with 0x00  }
  548.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size  }
  549.     END;
  550.  
  551.     CMUInt64ArrayTypePtr = ^CMUInt64ArrayType;
  552.     CMUInt64ArrayType = RECORD
  553.         typeDescriptor:            OSType;                                    {  'ui64'  }
  554.         reserved:                UInt32;                                    {  fill with 0x00  }
  555.         value:                    ARRAY [0..0] OF UInt32;                    {  Variable size (x2)  }
  556.     END;
  557.  
  558.     CMUInt8ArrayTypePtr = ^CMUInt8ArrayType;
  559.     CMUInt8ArrayType = RECORD
  560.         typeDescriptor:            OSType;                                    {  'ui08'  }
  561.         reserved:                UInt32;                                    {  fill with 0x00  }
  562.         value:                    SInt8;                                    {  Variable size  }
  563.     END;
  564.  
  565.     CMViewingConditionsTypePtr = ^CMViewingConditionsType;
  566.     CMViewingConditionsType = RECORD
  567.         typeDescriptor:            OSType;                                    {  'view'  }
  568.         reserved:                UInt32;                                    {  fill with 0x00  }
  569.         illuminant:                CMFixedXYZColor;                        {  absolute XYZs of illuminant  in cd/m^2  }
  570.         surround:                CMFixedXYZColor;                        {  absolute XYZs of surround in cd/m^2  }
  571.         stdIlluminant:            UInt32;                                    {  see definitions of std illuminants  }
  572.     END;
  573.  
  574.     CMXYZTypePtr = ^CMXYZType;
  575.     CMXYZType = RECORD
  576.         typeDescriptor:            OSType;                                    {  'XYZ '  }
  577.         reserved:                UInt32;                                    {  fill with 0x00  }
  578.         XYZ:                    ARRAY [0..0] OF CMFixedXYZColor;        {  variable size XYZ tristimulus values  }
  579.     END;
  580.  
  581. { Profile sequence description type }
  582.     CMProfileSequenceDescTypePtr = ^CMProfileSequenceDescType;
  583.     CMProfileSequenceDescType = RECORD
  584.         typeDescriptor:            OSType;                                    {  'pseq '  }
  585.         reserved:                UInt32;                                    {  fill with 0x00  }
  586.         count:                    UInt32;                                    {  Number of descriptions  }
  587.         data:                    SInt8;                                    {  varaible size data as explained below  }
  588.     END;
  589.  
  590. {
  591.     A variable size array of structs appears as the last block of data
  592.     in the above struct, CMProfileSequenceDescType.  The data structure
  593.     is as follows: (example in C)
  594.     
  595.     struct (                                             
  596.         OSType            deviceMfg;                     * Device Manufacturer 
  597.         OSType            deviceModel;                 * Decvice Model 
  598.         unsigned long    attributes[2];                 * Device attributes 
  599.         OSType            technology;                     * Technology signature 
  600.         unsigned long    mfgDescASCIICount;             * the count of "bytes" 
  601.         unsigned char    mfgDescASCIIName[2];         * Variable size 
  602.         unsigned long    mfgDescUniCodeCode;             
  603.         unsigned long    mfgDescUniCodeCount;         * the count of characters, each character has two bytes 
  604.         unsigned char    mfgDescUniCodeName[2];         * Variable size 
  605.         unsigned long    mfgDescScriptCodeCode;         
  606.         unsigned long    mfgDescScriptCodeCount;         * the count of "bytes" 
  607.         unsigned char    mfgDescScriptCodeName[2];     * Variable size 
  608.         unsigned long    modelDescASCIICount;         * the count of "bytes" 
  609.         unsigned char    modelDescASCIIName[2];         * Variable size 
  610.         unsigned long    modelDescUniCodeCode;         
  611.         unsigned long    modelDescUniCodeCount;         * the count of characters, each character has two bytes 
  612.         unsigned char    modelDescUniCodeName[2];     * Variable size 
  613.         short            modelDescScriptCodeCode;     
  614.         unsigned char    modelDescScriptCodeCount;     * the count of "bytes" 
  615.         SInt8            filler;                         * For proper alignment across languages 
  616.         unsigned char    modelDescScriptCodeName[2];     * Variable size 
  617.     )    profileDescription[1];                         
  618. }
  619.  
  620. { Under color removal, black generation type }
  621.     CMUcrBgTypePtr = ^CMUcrBgType;
  622.     CMUcrBgType = RECORD
  623.         typeDescriptor:            OSType;                                    {  'bfd  '  }
  624.         reserved:                UInt32;                                    {  fill with 0x00  }
  625.         ucrCount:                UInt32;                                    {  Number of UCR entries  }
  626.         ucrValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  627.         bgCount:                UInt32;                                    {  Number of BG entries  }
  628.         bgValues:                ARRAY [0..0] OF UInt16;                    {  variable size  }
  629.         ucrbgASCII:                SInt8;                                    {  null terminated ASCII string  }
  630.     END;
  631.  
  632.     CMIntentCRDVMSizePtr = ^CMIntentCRDVMSize;
  633.     CMIntentCRDVMSize = RECORD
  634.         renderingIntent:        LONGINT;                                {  rendering intent  }
  635.         VMSize:                    UInt32;                                    {  VM size taken up by the CRD  }
  636.     END;
  637.  
  638.     CMPS2CRDVMSizeTypePtr = ^CMPS2CRDVMSizeType;
  639.     CMPS2CRDVMSizeType = RECORD
  640.         typeDescriptor:            OSType;                                    {  'psvm'  }
  641.         reserved:                UInt32;                                    {  fill with 0x00  }
  642.         count:                    UInt32;                                    {  number of intent entries  }
  643.         intentCRD:                ARRAY [0..0] OF CMIntentCRDVMSize;        {  variable size  }
  644.     END;
  645.  
  646. { Video Card Gamma type }
  647.  
  648. CONST
  649.     cmVideoCardGammaTableType    = 0;
  650.     cmVideoCardGammaFormulaType    = 1;
  651.  
  652.  
  653.  
  654. TYPE
  655.     CMVideoCardGammaTablePtr = ^CMVideoCardGammaTable;
  656.     CMVideoCardGammaTable = RECORD
  657.         channels:                UInt16;                                    {  # of gamma channels (1 or 3)  }
  658.         entryCount:                UInt16;                                    {  1-based number of entries per channel  }
  659.         entrySize:                UInt16;                                    {  size on bytes of each entry  }
  660.         data:                    SInt8;                                    {  variable size data follows  }
  661.     END;
  662.  
  663.     CMVideoCardGammaFormulaPtr = ^CMVideoCardGammaFormula;
  664.     CMVideoCardGammaFormula = RECORD
  665.         redGamma:                Fixed;                                    {  must be > 0.0  }
  666.         redMin:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  667.         redMax:                    Fixed;                                    {  must be > 0.0 and < 1.0  }
  668.         greenGamma:                Fixed;                                    {  must be > 0.0  }
  669.         greenMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  670.         greenMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  671.         blueGamma:                Fixed;                                    {  must be > 0.0  }
  672.         blueMin:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  673.         blueMax:                Fixed;                                    {  must be > 0.0 and < 1.0  }
  674.     END;
  675.  
  676.     CMVideoCardGammaPtr = ^CMVideoCardGamma;
  677.     CMVideoCardGamma = RECORD
  678.         tagType:                UInt32;
  679.         CASE INTEGER OF
  680.         0: (
  681.             table:                CMVideoCardGammaTable;
  682.             );
  683.         1: (
  684.             formula:            CMVideoCardGammaFormula;
  685.             );
  686.     END;
  687.  
  688.     CMVideoCardGammaTypePtr = ^CMVideoCardGammaType;
  689.     CMVideoCardGammaType = RECORD
  690.         typeDescriptor:            OSType;                                    {  'vcgt'  }
  691.         reserved:                UInt32;                                    {  fill with 0x00  }
  692.         gamma:                    CMVideoCardGamma;
  693.     END;
  694.  
  695.     CMMakeAndModelPtr = ^CMMakeAndModel;
  696.     CMMakeAndModel = RECORD
  697.         manufacturer:            OSType;
  698.         model:                    UInt32;
  699.         serialNumber:            UInt32;
  700.         manufactureDate:        UInt32;
  701.         reserved1:                UInt32;                                    {  fill with 0x00  }
  702.         reserved2:                UInt32;                                    {  fill with 0x00  }
  703.         reserved3:                UInt32;                                    {  fill with 0x00  }
  704.         reserved4:                UInt32;                                    {  fill with 0x00  }
  705.     END;
  706.  
  707.     CMMakeAndModelTypePtr = ^CMMakeAndModelType;
  708.     CMMakeAndModelType = RECORD
  709.         typeDescriptor:            OSType;                                    {  'mmod'  }
  710.         reserved:                UInt32;                                    {  fill with 0x00  }
  711.         makeAndModel:            CMMakeAndModel;
  712.     END;
  713.  
  714. {**********************************************************************}
  715. {************** ColorSync 1.0 profile specification *******************}
  716. {**********************************************************************}
  717.  
  718. CONST
  719.     cmGrayResponse                = 0;
  720.     cmRedResponse                = 1;
  721.     cmGreenResponse                = 2;
  722.     cmBlueResponse                = 3;
  723.     cmCyanResponse                = 4;
  724.     cmMagentaResponse            = 5;
  725.     cmYellowResponse            = 6;
  726.     cmUcrResponse                = 7;
  727.     cmBgResponse                = 8;
  728.     cmOnePlusLastResponse        = 9;
  729.  
  730.  
  731. { Device types }
  732.     cmMonitorDevice                = 'mntr';
  733.     cmScannerDevice                = 'scnr';
  734.     cmPrinterDevice                = 'prtr';
  735.  
  736.  
  737.  
  738. TYPE
  739.     CMIStringPtr = ^CMIString;
  740.     CMIString = RECORD
  741.         theScript:                ScriptCode;
  742.         theString:                Str63;
  743.     END;
  744.  
  745. { Profile options }
  746.  
  747. CONST
  748.     cmPerceptualMatch            = $0000;                        {  Default. For photographic images  }
  749.     cmColorimetricMatch            = $0001;                        {  Exact matching when possible  }
  750.     cmSaturationMatch            = $0002;                        {  For solid colors  }
  751.  
  752. { Profile flags }
  753.     cmNativeMatchingPreferred    = $00000001;                    {  Default to native not preferred  }
  754.     cmTurnOffCache                = $00000002;                    {  Default to turn on CMM cache  }
  755.  
  756.  
  757. TYPE
  758.     CMMatchOption                        = LONGINT;
  759.     CMMatchFlag                            = LONGINT;
  760.     CMHeaderPtr = ^CMHeader;
  761.     CMHeader = RECORD
  762.         size:                    UInt32;
  763.         CMMType:                OSType;
  764.         applProfileVersion:        UInt32;
  765.         dataType:                OSType;
  766.         deviceType:                OSType;
  767.         deviceManufacturer:        OSType;
  768.         deviceModel:            UInt32;
  769.         deviceAttributes:        ARRAY [0..1] OF UInt32;
  770.         profileNameOffset:        UInt32;
  771.         customDataOffset:        UInt32;
  772.         flags:                    CMMatchFlag;
  773.         options:                CMMatchOption;
  774.         white:                    CMXYZColor;
  775.         black:                    CMXYZColor;
  776.     END;
  777.  
  778.     CMProfileChromaticitiesPtr = ^CMProfileChromaticities;
  779.     CMProfileChromaticities = RECORD
  780.         red:                    CMXYZColor;
  781.         green:                    CMXYZColor;
  782.         blue:                    CMXYZColor;
  783.         cyan:                    CMXYZColor;
  784.         magenta:                CMXYZColor;
  785.         yellow:                    CMXYZColor;
  786.     END;
  787.  
  788.     CMProfileResponsePtr = ^CMProfileResponse;
  789.     CMProfileResponse = RECORD
  790.         counts:                    ARRAY [0..8] OF UInt16;
  791.         data:                    ARRAY [0..0] OF UInt16;                    {  Variable size  }
  792.     END;
  793.  
  794.     CMProfilePtr = ^CMProfile;
  795.     CMProfile = RECORD
  796.         header:                    CMHeader;
  797.         profile:                CMProfileChromaticities;
  798.         response:                CMProfileResponse;
  799.         profileName:            CMIString;
  800.         customData:                SInt8;                                    {  Variable size  }
  801.     END;
  802.  
  803.     CMProfileHandle                        = ^CMProfilePtr;
  804. {$IFC OLDROUTINENAMES }
  805.  
  806. CONST
  807.     kCMApplProfileVersion        = $00000100;
  808.  
  809.     grayResponse                = 0;
  810.     redResponse                    = 1;
  811.     greenResponse                = 2;
  812.     blueResponse                = 3;
  813.     cyanResponse                = 4;
  814.     magentaResponse                = 5;
  815.     yellowResponse                = 6;
  816.     ucrResponse                    = 7;
  817.     bgResponse                    = 8;
  818.     onePlusLastResponse            = 9;
  819.  
  820.     rgbData                        = 'RGB ';
  821.     cmykData                    = 'CMYK';
  822.     grayData                    = 'GRAY';
  823.     xyzData                        = 'XYZ ';
  824.  
  825.     monitorDevice                = 'mntr';
  826.     scannerDevice                = 'scnr';
  827.     printerDevice                = 'prtr';
  828.  
  829.  
  830. TYPE
  831.     XYZComponent                        = UInt16;
  832.     XYZColor                            = CMXYZColor;
  833.     XYZColorPtr                         = ^XYZColor;
  834.     CMResponseData                        = UInt16;
  835.     IString                                = CMIString;
  836.     IStringPtr                             = ^IString;
  837.     CMResponseColor                        = LONGINT;
  838.     responseColor                        = CMResponseColor;
  839. {$ENDC}  {OLDROUTINENAMES}
  840.  
  841.  
  842. {$ALIGN RESET}
  843. {$POP}
  844.  
  845. {$SETC UsingIncludes := CMICCProfileIncludes}
  846.  
  847. {$ENDC} {__CMICCPROFILE__}
  848.  
  849. {$IFC NOT UsingIncludes}
  850.  END.
  851. {$ENDC}
  852.